package com.nine.gxh.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nine.gxh.model.GxhMessage;
import com.nine.gxh.service.GxhMessageService;
import com.nine.gxh.vos.GxhMessageVo;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author: duonine
 * @date: 2023/7/19
 */
@RestController
@RequestMapping("gxh/message")
public class GxhMessageController {

    @Resource
    private GxhMessageService gxhMessageService;

    @PostMapping("/list/{pageno}/{pagesize}")
    public AjaxResult listPage(
            @RequestBody GxhMessageVo vo,
            @PathVariable(value = "pageno") Long pageno,
            @PathVariable(value = "pagesize") Long pagesize) {
        IPage<GxhMessage> page = new Page<>(pageno, pagesize);
        page = gxhMessageService.listPage(page, vo);
        return AjaxResult.success(page);
    }

}
